package com.isoft.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.xml.bind.annotation.*;
import lombok.Data;

import java.util.List;

@Data
@XmlRootElement(name = "MSG")
@XmlAccessorType(XmlAccessType.FIELD)
public class DfmeSflgEntity {
    @JsonProperty("meta")
    @XmlElement(name = "META")
    private Meta meta;

    @JsonProperty("dflt")
    @XmlElement(name = "DFLT")
    private Dflt dflt;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Meta {
        @XmlElement(name = "MSGID")
        private Long msgId;
        @XmlElement(name = "SNDR")
        private String sender;
        @XmlElement(name = "RCVR")
        private String receiver;
        @XmlElement(name = "SEQN")
        private Long sequenceNumber;
        @XmlElement(name = "DDTM")
        private String dateTime;
        @XmlElement(name = "TYPE")
        private String type;
        @XmlElement(name = "STYP")
        private String subType;
        public Long getMsgId() { return msgId; }
        public void setMsgId(Long msgId) { this.msgId = msgId; }
        public String getSender() { return sender; }
        public void setSender(String sender) { this.sender = sender; }
        public String getReceiver() { return receiver; }
        public void setReceiver(String receiver) { this.receiver = receiver; }
        public Long getSequenceNumber() { return sequenceNumber; }
        public void setSequenceNumber(Long sequenceNumber) { this.sequenceNumber = sequenceNumber; }
        public String getDateTime() { return dateTime; }
        public void setDateTime(String dateTime) { this.dateTime = dateTime; }
        public String getType() { return type; }
        public void setType(String type) { this.type = type; }
        public String getSubType() { return subType; }
        public void setSubType(String subType) { this.subType = subType; }
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Dflt {
        @XmlElement(name = "FLID")
        private Long flightId;
        @XmlElement(name = "FIDE")
        private String flightIdentifier;
        @XmlElement(name = "FFID")
        private String flightFileId;
        @XmlElement(name = "SFLG")
        private Sflg sflg;

        @Data
        @XmlAccessorType(XmlAccessType.FIELD)
        public static class Sflg {
            @XmlElement(name = "SFLT")
            private List<Sflt> sflts;

            @Data
            @XmlAccessorType(XmlAccessType.FIELD)
            public static class Sflt {
                @XmlElement(name = "SFAW")
                private String airlineCode;
                @XmlElement(name = "SFNO")
                private String flightNumber;
            }
        }

        public Long getFlightId() { return flightId; }
        public void setFlightId(Long flightId) { this.flightId = flightId; }
        public Sflg getSflg() { return sflg; }
        public void setSflg(Sflg sflg) { this.sflg = sflg; }
    }

    public Meta getMeta() {
        return meta;
    }

    public void setMeta(Meta meta) {
        this.meta = meta;
    }

    public Dflt getDflt() {
        return dflt;
    }

    public void setDflt(Dflt dflt) {
        this.dflt = dflt;
    }
}